<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html">
    Choosing a Purchase Order to check.
    <p></p>
    <h:form>
        <h:outputText style="font-weight: bold" value="Choose Purchase Order to try convert from the list below:" />
        <h:selectOneMenu value="#{salesOrderBean.purchaseOrderId}">
            <f:selectItems value="#{salesOrderBean.purchaseOrderList}" var="s"
                           itemLabel="#{s.id}" itemValue="#{s.id}" />
        </h:selectOneMenu>

        <h:dataTable cellpadding="5px" cellspacing="16px" styleClass="allaroundborder" headerClass="allaroundborder" columnClasses="allaroundborder"
                     rowClasses="allaroundborder" value="#{salesOrderBean.purchaseOrderList}" var="purchaseorder">

            <h:column>
                <f:facet name="header">
                    <h:outputText value="Purchase Order Id" />
                </f:facet>
                <h:outputText value="#{purchaseorder.id}" />
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="Quotation Id" />
                </f:facet>
                <h:outputText value="#{purchaseorder.quotationId}" />
            </h:column>

            <h:column>
                <f:facet name="header">
                    <h:outputText value="Submitted By" />
                </f:facet>
                <h:outputText value="#{purchaseorder.submittedBy}" />
            </h:column>
            
            <h:column>
                <f:facet name="header">
                    <h:outputText value="Date Submitted" />
                </f:facet>
                <h:outputText value="#{purchaseorder.dateSubmitted}" />
            </h:column>
        </h:dataTable>

        <p></p><h:commandButton action="checkPurchaseResult.xhtml" value="Check purchase with quotation" actionListener="#{salesOrderBean.checkPurchaseOrder}"/>
        <p></p><h:commandButton action="index.xhtml" value="Return to index" actionListener="#{salesOrderBean.resetAll}"/>
    </h:form>
</ui:composition>